﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RDPCommon
{    
    public class EventWrapper : MarshalByRefObject
    {
        public event BroadCastEventHandler LocalBroadCastEvent;        
        public void BroadCasting(string message)
        {
            if (LocalBroadCastEvent!=null)
                LocalBroadCastEvent(message);
        }

        public event OnlienTestEventHandler LocalOnlienTestEvent;
        public void OnlienTest(RDPCommon.Client.ClinetInfo clientInfo)
        {
            if (LocalOnlienTestEvent != null)
                LocalOnlienTestEvent(clientInfo);
        }

        public event LoginNotifyEventHandler LocalLoginNotifyEvent;
        public void OnLoginNotify(RDPCommon.Client.ClinetInfo clientInfo)
        {
            if (LocalLoginNotifyEvent != null)
                LocalLoginNotifyEvent(clientInfo);
        }

        public event LogoutNotifyEventHandler LocalLogoutNotifyEvent;
        public void OnLogoutNotify(RDPCommon.Client.ClinetInfo clientInfo)
        {
            if (LocalLogoutNotifyEvent != null)
                LocalLogoutNotifyEvent(clientInfo);
        }

        /// <summary>
        /// 将对象的租用周期改变为无限
        /// </summary>
        /// <returns></returns>
        public override object InitializeLifetimeService()
        {
            return null;
        }

    }
}
